/**
    Copyright 2015 Table Rider
    By: Christoffer Lindström & Daniel Westerlund
*/

#ifdef __linux__
#include <sys/socket.h>
#include <arpa/inet.h> //

#elif __WIN32
#include <winsock.h>
#endif

#include <stdio.h>
#include <cstdlib>
#include <string.h>
#include <unistd.h> //


#ifndef COMCLIENT_H
#define COMCLIENT_H
class ComClient
{
private:
#ifdef _WIN32
    SOCKET ComSocket;
#elif __linux__
    int ComSocket;
#endif
    char recv_msg[2000];
    unsigned long ipnumber;
    int portnumber;
    struct sockaddr_in server;

public:
    ComClient();
    virtual ~ComClient();
    const char* init(const char*, int);
    const char* init(unsigned long, int);
    int send_msg(void*, int);
    const char* receive_msg();
    void close_connection();

};
#endif
